package vn.mycrm.server.entity;

import javax.jdo.annotations.Persistent;

import vn.mycrm.client.model.LoaiCH;


public class LoaiCHEntity extends AbstractEntity {
	
	@Persistent
	private String ten;
	
	@Persistent
	private String mota;

	public LoaiCHEntity (LoaiCH dto) {
		setTen(dto.getTen());
		setMota(dto.getMota());
		setGhiChu(dto.getGhiChu());
	}
	
	public boolean update(LoaiCH dto){
		boolean isupdate = false;
		if(dto.getTen().compareTo(getTen()) != 0){
			isupdate = true;
			setTen(dto.getTen());
		}
		if(dto.getMota().compareTo(getMota()) != 0){
			isupdate = true;
			setMota(dto.getMota());
		}		
		if(dto.getGhiChu().compareTo(getGhiChu())==0){
			isupdate = true;
			setGhiChu(dto.getGhiChu());
		}
		return isupdate;
	}
	
	public String getTen() {
		return ten;
	}

	public void setTen(String ten) {
		this.ten = ten;
	}

	public String getMota() {
		return mota;
	}

	public void setMota(String mota) {
		this.mota = mota;
	}	
}
